﻿// Decompiled with JetBrains decompiler
// Type: PetaPoco.Transaction
// Assembly: 开发辅助工具, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null
// MVID: F78E5980-5E94-4E46-ABDF-DC8C6CBF52AA
// Assembly location: K:\Tools\工具\开发辅助工具庆六一版\开发辅助工具2015-06-01\开发辅助工具.exe

using System;

namespace PetaPoco
{
  public class Transaction : IDisposable
  {
    private Database _db;

    public Transaction(Database db)
    {
      this._db = db;
      this._db.BeginTransaction();
    }

    public virtual void Complete()
    {
      this._db.CompleteTransaction();
      this._db = (Database) null;
    }

    public void Dispose()
    {
      if (this._db == null)
        return;
      this._db.AbortTransaction();
    }
  }
}
